﻿using Antix.Mail.Smtp.Impostor;
using Xunit;

namespace Antix.Mail.Tests
{
    public class ForwardMessageTests
    {
        [Fact]
        public void MessageIsForwarded()
        {
            using (var server = new Server())
            {
                var forwardingHost = server.CreateForwardHost(26, "localhost", 27);
                var destinationHost = server.CreateFileHost(27, "ForwardMessageTests");

                forwardingHost.Start();
                destinationHost.Start();

                ImpostorTests.SendEmails(server, 1);

                Assert.Equal(1, destinationHost.Messages.Count);
            }
        }
    }
}